<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class User extends Model
{
    // 定义时间戳字段名
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';
    protected $name = 'user';

    /**
     * 上传的图片
     * @return \think\model\relation\HasOne
     */
    public function avatarUpload()
    {
        return $this->hasOne(SystemUploadfile::class, 'id', 'avatar_id');
    }
}
